import { ReactNode } from 'react';
import { ISearchData } from '../../designer/service';
import * as InbizGraph from 'inbiz-graph';
import {useTemplate} from '@inbiz/hooks'

export default function (path?:string){
  return useTemplate<{
    ListView?: (props: {
      data: ISearchData['RawList'][number];
      checkbox?: ReactNode;
      icon?: string;
      checked?: boolean;
      config: object;
      inbiz: any;
      closePanel?: any;
      KeyWord?: any;
      SecondaryWord?: any;
      setTag?: any,
      emit?: Function;
      dataList?: any,
      onSelect?: any,
      getMessage?: any,
      GlobalRegistry: any,
      version: number, // v7还是v6
    }) => ReactNode;
    ThumbnailView?: (props: {
      data: ISearchData['RawList'][number];
      checkbox?: ReactNode;
      icon?: string;
      checked?: boolean;
      config: object;
      inbiz: any;
      setTag?: any,
      emit?: Function;
    }) => ReactNode;
    MainView?: (props: {
      data?: ISearchData;
      dataSoure?: ISearchData['RawList']; // 移动化中的数据
      sort: any;
      handleSortChange: Function;
      showStyle: string;
      handleChangeShowStyle?: Function;
      config: object;
      loading: boolean;
      selected?: ISearchData['RawList'];
      handleSelectedChange?: Function;
      uniqueKey: string;
      handleSynonymWordClick?: Function;
      synonymWordList?: unknown[];
      handleShowSection?: Function;
      InfiniteScroll?: React.ReactElement;
      inbiz: any;
      plugin?: ReactNode
    }) => React.ReactElement;
    default?:(props: any) => React.ReactElement // 移动端自定义切面
  }>(path, {
    packages: {InbizGraph}
  })
}
